package cn.tedu.spring.di;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestUserDao {

    @Test
    public void Test01(){
//        1.基于注解方式创建Ioc容器
        ApplicationContext context=
                new AnnotationConfigApplicationContext("cn.tedu.spring.di");

//        获取Ioc容器中已经创建好的对象
        UserService userService = context.getBean(UserService.class);

//        对获取到的Spring bean类进行打印
        System.out.println("userService = " + userService);

    }
}
